/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.*;
import net.customware.gwt.dispatch.client.DefaultDispatchAsync;
import net.customware.gwt.dispatch.client.DispatchAsync;
import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.place.PlaceManager;

/**
 * Main entry point.
 *
 * @author glenn
 */
public class BoatskeeperEntryPoint implements EntryPoint {

    //private final BoatsGinjector injector = GWT.create(BoatsGinjector.class);
    /**
     * Creates a new instance of boatskeeperEntryPoint
     */
    public BoatskeeperEntryPoint() {
    }

    /**
     * The entry point method, called automatically by loading a module that
     * declares an implementing class as an entry-point
     */
    @Override
    public void onModuleLoad() {


        DefaultEventBus eventBus = new DefaultEventBus();
        PlaceManager placeManager = new PlaceManager(eventBus);

        DispatchAsync dispather = new DefaultDispatchAsync();

        AppController appPresenter = new AppController(eventBus, dispather);

        MainLayout mainLayout = new MainLayout(Unit.EM);

        RootLayoutPanel.get().add(mainLayout);
        appPresenter.setLayout(mainLayout);

        //appPresenter.go(mainLayout.getContentPanel());
        placeManager.fireCurrentPlace();



    }
}
